package patternmining.model.construction.bpsl;

import patternmining.model.construction.File;
import patternmining.model.construction.Source;
import patternmining.model.graph.Graph;
import patternmining.model.graph.bpsl.BpslFormula;

public class BpslSource implements Source {

    protected BpslFormula graph;
    private BpslFile sourceFile;

    public BpslSource(){
    }

    public void buildGraph() {
        sourceFile.buildAst();
        BpslAst ast = sourceFile.getAst();
        ast.analizeAst();
        graph = ast.getFormula();
    }

    public Graph getGraph() {
        return graph;
    }

    public void includeFile(File file) {
        if(! (file instanceof BpslFile) ) throw new ClassCastException();
        sourceFile = (BpslFile) file;
    }
	 
}
 
